<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="../static/asserts/css/login.css">
    <link rel="shortcut icon" href="../static/asserts/images/login_logo.png" />
<!--    <link rel='stylesheet' id='main-css-css'  href='../static/asserts/css/main.css?ver=1.0' type='text/css' media='all' />-->
    <title>登录</title>
</head>
<body>
<div id="content">
    <div class="login-header">
        <img src="../static/asserts/images/login_logo.png">
    </div>
    <form action="/index_login" id="login" method="post" th:action="@{/index_login}" >
        <p class="error-msg" style="color: red; text-align: center; font-size: 12px; line-height: 5px" th:text="${msg}" th:if="${not #strings.isEmpty(msg)}"></p>
        <div class="login-input-box">
            <span class="icon icon-user"></span>
            <input type="text" name="username" id="username" placeholder="Please enter your username" required>
        </div>
        <div class="login-input-box">
            <span class="icon icon-password"></span>
            <input type="password"name="password" placeholder="Please enter your password" required>
        </div>
    </form>
    <br>
    <div class="login-button-box">
        <input type="submit" value="Login" form="login" onclick="submit()">
    </div>
    <div class="logon-box">
        <a th:href="@{/tourist_login}">Tourist</a>
        <a th:href="@{/retrievepassword}">Forgot?</a>
        <a th:href="@{/register}">Register</a>
    </div>
</div>
</body>
<script>
    function submit(){
        var str = document.getElementById("username").value.trim();
        setInfo(str);
    }
    //储存数据  
    function setInfo(name) {
        var storage = window.sessionStorage;
        storage.setItem("username", name);
    }
</script>
</html>